unit AbreRecebimentoNaoFiscal;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Mask;

type
  TFormAbreRecebimentoNaoFiscal = class(TForm)
    Edit1: TEdit;
    GBValor: TGroupBox;
    RB_DescontoValor: TRadioButton;
    RB_DescontoPercentual: TRadioButton;
    MaskEdit1: TMaskEdit;
    GBTIpo: TGroupBox;
    RB_Desconto: TRadioButton;
    RB_Acrescimo: TRadioButton;
    BitBtn1: TBitBtn;
    MaskEdit2: TMaskEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure RB_DescontoPercentualClick(Sender: TObject);
    procedure RB_DescontoValorClick(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormAbreRecebimentoNaoFiscal: TFormAbreRecebimentoNaoFiscal;

implementation

uses principal;

{$R *.dfm}

procedure TFormAbreRecebimentoNaoFiscal.RB_DescontoPercentualClick(
  Sender: TObject);
begin
        MaskEdit1.MaxLength:=4;
        MaskEdit1.EditMask:='9999';
        MaskEdit1.Text:='1000';

end;

procedure TFormAbreRecebimentoNaoFiscal.RB_DescontoValorClick(
  Sender: TObject);
begin
        MaskEdit1.MaxLength:=9;
        MaskEdit1.EditMask:='999999,99';
        MaskEdit1.Text:='000001,00';

end;

procedure TFormAbreRecebimentoNaoFiscal.BitBtn1Click(Sender: TObject);
begin
        FormPrincipal.ItemDesc:=Edit1.Text;
        if Rb_DescontoValor.checked then FormPrincipal.TipoDescontoItem:='$'
        else FormPrincipal.TipoDescontoItem:='%';
        if Rb_Desconto.checked then FormPrincipal.TipoDescontoAcrescimo:='D'
        else FormPrincipal.TipoDescontoAcrescimo:='A';
        FormPrincipal.DescontoItem:=MaskEdit1.Text;
        FormPrincipal.ValorInicioDia:=MaskEdit2.Text;
        Close;

end;

end.
